/*
 *  Copyright 2011 Yuri Kanivets
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.itboye.ihomebank.wheelview.adapter;

import android.database.DataSetObserver;
import android.view.View;
import android.view.ViewGroup;

/**
 * 车轮项目适配器接口
 */
public interface WheelViewAdapter {
	
	/**
	 * 获取项目数
	 * @return 返回车轮项目的计数
	 */
	public int getItemsCount();
	
	/**
	 * 获取一个视图，该视图在数据集的指定位置显示数据
	 * 
	 * @param 指标项目指标
	 * @param convertview旧视图重用如果可能的话
	 * @param parent the parent that this view will eventually be attached to
	 * @return 返回车轮项目视图
	 */
	public View getItem(int index, View convertView, ViewGroup parent);

	/**
	 * 获取一个视图，显示在第一个或之后放置的一个空的车轮项目
	 * 最后一轮项目
	 * 
	 * @param convertview旧视图重用如果可能的话
     * @param parent the parent that this view will eventually be attached to
	 * @return 返回空项目视图
	 */
	public View getEmptyItem(View convertView, ViewGroup parent);
	
	/**
	 * 注册一个被调用的观察者，当这个适配器所使用的数据发生变化时。
	 * @param 观察员观察员必须注册
	 */
	public void registerDataSetObserver(DataSetObserver observer);
	
	/**
	 * 注销一个观察者先前已被注册，
	 * @param 观察员未登记
	 */
	void unregisterDataSetObserver (DataSetObserver observer);
	
}
